
{extend name="layout/common_layout" /}
{block name="body"}
<!--tab标签-->
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class="layui-this">Banner管理</li>
        <li class=""><a href="{:url('admin/Banner/add')}">添加Banner</a></li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form layui-form-pane" action="{:url('admin/Banner/index')}" method="post">
                <div class="layui-inline">
                    <label class="layui-form-label">商品名称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="title" value="{:input('title')}" placeholder="请输入商品名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn">搜索</button>
                </div>
            </form>
            <hr>

            <table class="layui-table">
                <thead>
                <tr>
                    <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                    <th>名称</th>
                    <th>内容</th>
                    <th>状态</th>
                    <th>添加时间</th>
                    <th>更新时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {foreach name="list" item="vo"}
                <tr>
                    <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                    <td>{$vo.title}</td>
                    <td><img src="{$vo.photo}" width="50px;"/></td>
                    <td>{php}echo $vo['status']==1 ? '启用' : '禁用';{/php}</td>
                    <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                    <td>{$vo.update_time|date="Y-m-d H:i:s",###}</td>
                    <td>
                        <a href="{:url('admin/banner/detail',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                        <a href="{:url('admin/banner/updatestatus',['id'=>$vo['id'],'status'=>$vo['status']])}" class="layui-btn layui-btn-mini ajax-goods">{php}echo $vo['status']==2 ? '启用' : '禁用';{/php}</a>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
            <!--分页-->
            {notempty name = 'list'}
            {$list->render()}
            {/notempty}
        </div>
    </div>
</div>
{/block}